<?php if (isset($this->negociosPorTag) && !empty($this->negociosPorTag)):?>
<div class="sideBox sideBoxOrange">
	<?php 
	
	$names = array(
		'barrio' => 'byDistrict',
		'cocina' => 'byCuisine',
		'comida' => 'byFood',
		'tipo' 	 => 'byType',
	);
	
	$currentId = isset($this->tag) ? $this->tag->getId() : null;
	
	foreach ($this->negociosPorTag as $tipo=>$data){
		
		if( $tipo == "barrio" && !isset($this->ciudad)){
			continue;
		}
		
		echo '<h4 class="subTitle subTitleActive '.$tipo.'"><span class="icon iconArrow"></span>'. $this->translate($names[$tipo]).'</h4>';
		echo '<ul>';
		
		foreach ($data as $dat){
			
			$tag = $dat['tag'];
			$num = $dat['num'];
			
			
			$tagName = $this->varUrl( $tag->nombre );
			
			if ( isset($this->ciudad)){
			    $ciudad = $this->varUrl( $this->ciudad->nombre );
		        $provincia = $this->varUrl( $this->ciudad->provincia );
//		        $class =  $currentId == $row['idCiudad'] ? ' class="current" ' : null;
		        $url = $this->url(array('ciudad' => $ciudad, 'provincia' => $provincia,'tagName' => $tagName), 'ciudad-tag');
			    
			} else {
			    $url = $this->url(array('tagName' => $tagName), $tipo);
			}
			
			$class =  $currentId == $tag->getId() ? ' class="current"' : null;
			
			
			echo "<li><a{$class} href='{$url}'>{$tag->nombre} ({$num})</a></li>";
			
		}
		
		
		echo '</ul>';
	
	}		
	?>	
</div>
<?php endif;

$this->jQuery()->onLoadCaptureStart();
?>
bindLeftMenu();
<?php
$this->jQuery()->onLoadCaptureEnd();
